Feature: MSErrorReportHandler tests

  Scenario: Can filter call stacks Microsoft related package functions
    Given the full call stacks to filter MSCallStacks
      """
    IdeaLoggingEvent[message=null, throwable=java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add `onError` handling.
		at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:57)
		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
		at java.util.concurrent.FutureTask.run(FutureTask.java:266)
		at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
		at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
		at java.lang.Thread.run(Thread.java:748)
	Caused by: rx.exceptions.OnErrorNotImplementedException: Coordinate out of bounds!
		at rx.internal.util.InternalObservableUtils$ErrorNotImplementedAction.call(InternalObservableUtils.java:386)
		at rx.internal.util.InternalObservableUtils$ErrorNotImplementedAction.call(InternalObservableUtils.java:383)
		at rx.internal.util.ActionSubscriber.onError(ActionSubscriber.java:44)
		at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:153)
		at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:115)
		at rx.exceptions.Exceptions.throwOrReport(Exceptions.java:212)
		at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:139)
		at rx.internal.operators.OperatorTake$1.onNext(OperatorTake.java:79)
		at rx.internal.operators.OperatorSubscribeOn$SubscribeOnSubscriber.onNext(OperatorSubscribeOn.java:74)
		at rx.internal.operators.OnSubscribeTimerOnce$1.call(OnSubscribeTimerOnce.java:49)
		at rx.internal.schedulers.EventLoopsScheduler$EventLoopWorker$2.call(EventLoopsScheduler.java:189)
		at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
		... 7 more
	Caused by: java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
		at sun.awt.image.IntegerInterleavedRaster.getDataElements(IntegerInterleavedRaster.java:264)
		at sun.awt.image.OffScreenImageSource.sendPixels(OffScreenImageSource.java:136)
		at sun.awt.image.OffScreenImageSource.produce(OffScreenImageSource.java:187)
		at sun.awt.image.OffScreenImageSource.addConsumer(OffScreenImageSource.java:66)
		at sun.awt.image.OffScreenImageSource.startProduction(OffScreenImageSource.java:80)
		at java.awt.image.FilteredImageSource.startProduction(FilteredImageSource.java:183)
		at sun.awt.image.ImageRepresentation.startProduction(ImageRepresentation.java:732)
		at sun.awt.image.ToolkitImage.addWatcher(ToolkitImage.java:221)
		at sun.awt.image.ToolkitImage.getProperty(ToolkitImage.java:169)
		at javax.swing.ImageIcon.<init>(ImageIcon.java:240)
		at com.microsoft.intellij.util.PluginUtil.getIcon(PluginUtil.java:183)
		at com.microsoft.azuretools.ijidea.ui.SurveyPopUpDialog.createUIComponents(SurveyPopUpDialog.java:223)
		at com.microsoft.azuretools.ijidea.ui.SurveyPopUpDialog.$$$setupUI$$$(SurveyPopUpDialog.java)
		at com.microsoft.azuretools.ijidea.ui.SurveyPopUpDialog.<init>(SurveyPopUpDialog.java:55)
		at com.microsoft.intellij.helpers.CustomerSurveyHelper.lambda$showFeedbackNotification$0(CustomerSurveyHelper.java:68)
		at rx.internal.util.ActionSubscriber.onNext(ActionSubscriber.java:39)
		at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:134)
		... 12 more
      """
    Then check the filtered MSCallStacks result
      """
    IdeaLoggingEvent[message=null, throwable=java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add `onError` handling.
		at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:57)
	Caused by: rx.exceptions.OnErrorNotImplementedException: Coordinate out of bounds!
	Caused by: java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
		at com.microsoft.intellij.util.PluginUtil.getIcon(PluginUtil.java:183)
		at com.microsoft.azuretools.ijidea.ui.SurveyPopUpDialog.createUIComponents(SurveyPopUpDialog.java:223)
		at com.microsoft.azuretools.ijidea.ui.SurveyPopUpDialog.$$$setupUI$$$(SurveyPopUpDialog.java)
		at com.microsoft.azuretools.ijidea.ui.SurveyPopUpDialog.<init>(SurveyPopUpDialog.java:55)
		at com.microsoft.intellij.helpers.CustomerSurveyHelper.lambda$showFeedbackNotification$0(CustomerSurveyHelper.java:68)
      """
    Given the full call stacks to filter MSCallStacks
      """
    java.lang.NullPointerException


        at java.desktop/javax.swing.text.CompositeView.replace(CompositeView.java:219)
        at java.desktop/javax.swing.text.BoxView.replace(BoxView.java:182)
        at java.desktop/javax.swing.text.FlowView$FlowStrategy.layoutRow(FlowView.java:592)
        at java.desktop/javax.swing.text.FlowView$FlowStrategy.layout(FlowView.java:498)
        at java.desktop/javax.swing.text.FlowView.layout(FlowView.java:209)
        at java.desktop/javax.swing.text.BoxView.setSize(BoxView.java:398)
        at java.desktop/javax.swing.text.BoxView.updateChildSizes(BoxView.java:367)
        at java.desktop/javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:335)
        at java.desktop/javax.swing.text.BoxView.layout(BoxView.java:710)
        at java.desktop/javax.swing.text.BoxView.setSize(BoxView.java:398)
        at java.desktop/javax.swing.text.BoxView.updateChildSizes(BoxView.java:367)
        at java.desktop/javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:349)
        at java.desktop/javax.swing.text.BoxView.layout(BoxView.java:709)
        at java.desktop/javax.swing.text.BoxView.setSize(BoxView.java:398)
        at java.desktop/javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1816)
        at java.desktop/javax.swing.plaf.basic.BasicTextUI.getPreferredSize(BasicTextUI.java:943)
        at java.desktop/javax.swing.JComponent.getPreferredSize(JComponent.java:1680)
        at java.desktop/javax.swing.JEditorPane.getPreferredSize(JEditorPane.java:1345)
        at com.intellij.ui.components.JBLabel.updateTextAlignment(JBLabel.java:343)
        at com.intellij.ui.components.JBLabel.setText(JBLabel.java:153)
        at com.intellij.execution.impl.SingleConfigurationConfigurable$MyValidatableComponent.updateWarning(SingleConfigurationConfigurable.java:467)
        at com.intellij.execution.impl.SingleConfigurationConfigurable$MyValidatableComponent.lambda$new$0(SingleConfigurationConfigurable.java:351)
        at com.intellij.openapi.options.SettingsEditor.fireEditorStateChanged(SettingsEditor.java:136)
        at com.intellij.openapi.options.SettingsEditor$2.stateChanged(SettingsEditor.java:114)
        at jdk.internal.reflect.GeneratedMethodAccessor371.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at com.intellij.util.EventDispatcher.dispatchVoidMethod(EventDispatcher.java:130)
        at com.intellij.util.EventDispatcher.access$000(EventDispatcher.java:24)
        at com.intellij.util.EventDispatcher$1.invoke(EventDispatcher.java:88)
        at com.sun.proxy.$Proxy169.stateChanged(Unknown Source)
        at com.intellij.ui.UserActivityWatcher.fireUIChanged(UserActivityWatcher.java:92)
        at com.intellij.ui.UserActivityWatcher$1.textChanged(UserActivityWatcher.java:27)
        at com.intellij.ui.DocumentAdapter.insertUpdate(DocumentAdapter.java:15)
        at java.desktop/javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:203)
        at java.desktop/javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:757)
        at java.desktop/javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:716)
        at java.desktop/javax.swing.text.PlainDocument.insertString(PlainDocument.java:131)
        at java.desktop/javax.swing.text.AbstractDocument.replace(AbstractDocument.java:675)
        at java.desktop/javax.swing.text.JTextComponent.setText(JTextComponent.java:1729)
        at java.desktop/javax.swing.plaf.basic.BasicComboBoxEditor$BorderlessTextField.setText(BasicComboBoxEditor.java:151)
        at java.desktop/javax.swing.plaf.basic.BasicComboBoxEditor.setItem(BasicComboBoxEditor.java:93)
        at com.intellij.openapi.ui.ComboBox$MyEditor.setItem(ComboBox.java:363)
        at java.desktop/javax.swing.JComboBox.setSelectedItem(JComboBox.java:573)
        at com.microsoft.azure.hdinsight.common.viewmodels.ComboBoxSelectionDelegated.setValueInDispatch(SwingComponentPropertyDelegated.kt:77)
        at com.microsoft.azure.hdinsight.common.viewmodels.SwingComponentPropertyDelegated$setValue$1.run(SwingComponentPropertyDelegated.kt:39)
        at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:433)
        at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:416)
        at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:399)
        at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
        at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:878)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:827)
        at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:466)
        at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:693)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:465)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
        at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
        at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
        at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
        at java.desktop/java.awt.Dialog.show(Dialog.java:1063)
        at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:707)
        at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:432)
        at com.intellij.openapi.ui.DialogWrapper.doShow(DialogWrapper.java:1685)
        at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1644)
        at com.intellij.openapi.ui.DialogWrapper.showAndGet(DialogWrapper.java:1658)
        at com.intellij.execution.impl.RunDialog.editConfiguration(RunDialog.java:114)
        at com.intellij.execution.impl.RunDialog.editConfiguration(RunDialog.java:99)
        at com.microsoft.azure.hdinsight.spark.run.action.RunConfigurationActionUtils.runEnvironmentProfileWithCheckSettings(RunConfigurationActionUtils.kt:64)
        at com.microsoft.azure.hdinsight.spark.run.action.SparkRunConfigurationAction.runFromSetting(SparkRunConfigurationAction.kt:171)
        at com.microsoft.azure.hdinsight.spark.run.action.SparkRunConfigurationAction.access$runFromSetting(SparkRunConfigurationAction.kt:47)
        at com.microsoft.azure.hdinsight.spark.run.action.SparkRunConfigurationAction$runExisting$1.invoke(SparkRunConfigurationAction.kt:163)
        at com.microsoft.azure.hdinsight.spark.run.action.SparkRunConfigurationAction$runExisting$1.invoke(SparkRunConfigurationAction.kt:47)
        at com.microsoft.intellij.util.ApplicationHelpersKt.runInReadAction(ApplicationHelpers.kt:42)
        at com.microsoft.azure.hdinsight.spark.run.action.SparkRunConfigurationAction.runExisting(SparkRunConfigurationAction.kt:162)
        at com.microsoft.azure.hdinsight.spark.run.action.SparkRunConfigurationAction.onActionPerformed(SparkRunConfigurationAction.kt:116)
        at com.microsoft.azuretools.ijidea.utility.AzureAnAction.actionPerformed(AzureAnAction.java:75)
        at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:265)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:282)
        at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:256)
        at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:194)
        at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:157)
        at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:434)
        at java.desktop/java.awt.Component.processEvent(Component.java:6416)
        at java.desktop/java.awt.Container.processEvent(Container.java:2263)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
        at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
        at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
        at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2772)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
        at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:878)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:823)
        at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:466)
        at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:465)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
      """
    Then check the filtered MSCallStacks result
      """
    java.lang.NullPointerException
        at java.desktop/javax.swing.text.CompositeView.replace(CompositeView.java:219)
        at com.microsoft.azure.hdinsight.common.viewmodels.ComboBoxSelectionDelegated.setValueInDispatch(SwingComponentPropertyDelegated.kt:77)
        at com.microsoft.azure.hdinsight.common.viewmodels.SwingComponentPropertyDelegated$setValue$1.run(SwingComponentPropertyDelegated.kt:39)
        at com.microsoft.azure.hdinsight.spark.run.action.RunConfigurationActionUtils.runEnvironmentProfileWithCheckSettings(RunConfigurationActionUtils.kt:64)
        at com.microsoft.azure.hdinsight.spark.run.action.SparkRunConfigurationAction.runFromSetting(SparkRunConfigurationAction.kt:171)
        at com.microsoft.azure.hdinsight.spark.run.action.SparkRunConfigurationAction.access$runFromSetting(SparkRunConfigurationAction.kt:47)
        at com.microsoft.azure.hdinsight.spark.run.action.SparkRunConfigurationAction$runExisting$1.invoke(SparkRunConfigurationAction.kt:163)
        at com.microsoft.azure.hdinsight.spark.run.action.SparkRunConfigurationAction$runExisting$1.invoke(SparkRunConfigurationAction.kt:47)
        at com.microsoft.intellij.util.ApplicationHelpersKt.runInReadAction(ApplicationHelpers.kt:42)
        at com.microsoft.azure.hdinsight.spark.run.action.SparkRunConfigurationAction.runExisting(SparkRunConfigurationAction.kt:162)
        at com.microsoft.azure.hdinsight.spark.run.action.SparkRunConfigurationAction.onActionPerformed(SparkRunConfigurationAction.kt:116)
        at com.microsoft.azuretools.ijidea.utility.AzureAnAction.actionPerformed(AzureAnAction.java:75)
      """
